<table class="table table-bordered" id="edit-field-manage-table" data-toggle="datagrid" data-options="{
    tableWidth: '100%',
    height: '100%',
    gridTitle : '{{$data['process']['title']}}-字段管理',
    showToolbar: true,
    toolbarItem: '',
    local: 'local',
    data: {!! $data['lists'] !!},
    paging: {pageSize:50, pageCurrent:5},
    linenumberAll: false,
    showLinenumber: false,
    showCheckboxcol: true,
    filterThead: false,
    showEditbtnscol:'操作',
    customEditbtns:{ position:'replace',buttons:editButton,width:0},
    editUrl: '/admin/process/field-manage-edit',
    editCallback:editCallback,
    delUrl:'/admin/process/field-manage-delete',
    delConfirm: true,
}">
    <thead>
    <tr>
        <!--<th data-options="{name:'field_name',align:'center',edit:false}">字段名称</th>-->
        <th data-options="{name:'title',align:'center',edit:false}">字段中文</th>
        <th data-options="{name:'field_type',items:{{$jsonData['field_type_list']}},align:'center',edit:false}">字段类型</th>
        <th data-options="{align:'center',width:200,render:permission_assignment}">类型设置</th>
        <th data-options="{name:'is_must',type:'select',items:[{'0':'选填'},{'1':'必填'}],align:'center'}">是否必填</th>
        <th data-options="{name:'orderby',align:'center'}">排序</th>
    </tr>
    </thead>
</table>
<script type="text/javascript">

    function permission_assignment(value, data)
    {
        var html  = '<button type="button" class="btn btn-info" data-toggle="navtab" data-options="';
            html  += '{id:\'process-field-set-navtab\',title:\'工序字段编辑\',fresh:true,';
            html  += 'url:\'/admin/process/field-set\',data:{relation_id:' + data.relation_id + '}}';
            html  += '">工序字段编辑</button>';
        var arr   = [ 3, 5, 11, 13, 14 ];
        if( field_type_in_array(data.field_type, arr) ){
            return html;
        } else {
            return '';
        }
    }
    function field_type_in_array( field_type, arr ){
        for(var i in arr){
            if( arr[i] == field_type ){
                return true;
            }
        }
        return false;
    }
</script>